<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //关键问题一  如何修改 promise 对象状态
        let p = new Promise((resolve, reject) => {
            //1. resolve
            // resolve('success');
            //2. reject
            // reject('error');
            //3. 抛出错误 异常
            // throw '出问题啦! 你说出这样的话  你没有良心!!';
            // 状态的改变只有一次 
            resolve('ok');
            reject('error');
        });

        console.log(p);



    </script>
</body>
</html>